//////////////////////////////////////////////////////////////////////////////////////////
// NAME: Testing.java								            						//
// AUTHOR: CDT Peter Lofreddo															//
// LAST MODIFIED: 12 February 2012														//
// DESCRIPTION: Testing File used for Testing of Nullwall Application Firewall.  Not	//
// needed to run Nullwall, but useful when creating debugging							//
// LIMITATIONS: 																		//
// CITATIONS: Inside Individual Methods.												//
//																						//
////////////////////////////////////////////////////////////////////////////////////////// 
package com.Project.Nullwall;

import android.os.Environment;

public class Testing extends Main{

	
	public void checkExternalMedia() {
		//////////////////////////////////////////////////////////////////////////////////////////
		// NAME: checkExternalMedia() 															//
		// AUTHOR: CDT Peter Lofreddo 															//
		// LAST MODIFIED: 29 January 2012 														//
		// DESCRIPTION: Determines whether external media is available and						//
		// writable.  Useful for making sure USB Storage Mode is disabled and file can be		//
		// written.																				//
		// CITATIONS: Copied from http://eagle.phys.utk.edu/guidry/android/writeSD.html 		//
		// 																						//
		// ///////////////////////////////////////////////////////////////////////////////////////
		boolean mExternalStorageAvailable = false;
		boolean mExternalStorageWriteable = false;
		String state = Environment.getExternalStorageState();

		if (Environment.MEDIA_MOUNTED.equals(state)) {
			// Can read and write the media
			mExternalStorageAvailable = mExternalStorageWriteable = true;
		} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
			// Can only read the media
			mExternalStorageAvailable = true;
			mExternalStorageWriteable = false;
		} else {
			// Can't read or write
			mExternalStorageAvailable = mExternalStorageWriteable = false;
		}
		tv.append("\n\nExternal Media: readable=" + mExternalStorageAvailable
				+ " writable=" + mExternalStorageWriteable);
	}
	


}
